# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from pydantic import BaseModel, Field


class SmsParams(BaseModel):
    """ 短信参数 """
    sign: str = Field(default="", description="短信签名")
    app_id: str = Field(default="", description="app_id")
    acc_key: str = Field(default="", description="key")
    acc_secret: str = Field(default="", description="secret")


class SmsListVo(BaseModel):
    """ 短信列表Vo """
    alias: str = Field(description="短信别名")
    name: str = Field(description="短信名称")
    desc: str = Field(description="短信描述")
    image: str = Field(description="短信图标")
    status: int = Field(ge=0, le=1, description="短信状态: [0=禁用, 1=启用]")

    class Config:
        json_schema_extra = {
            "example": {
                "alias": "aliyun",
                "name": "阿里云短信",
                "desc": "阿里云短信服务（Short Message Service）",
                "image": "http://0.0.0.0:8100/static/images/service_aliyun.png",
                "status": 1
            }
        }


class SmsDetailVo(BaseModel):
    """ 短信详情Vo """
    alias: str = Field(description="短信别名")
    name: str = Field(description="短信名称")
    status: int = Field(ge=0, le=1, description="短信状态: [0=禁用, 1=启用]")
    params: SmsParams = Field(description="短信参数")

    class Config:
        json_schema_extra = {
            "example": {
                "alias": "aliyun",
                "name": "阿里云短信",
                "status": 1,
                "params": {
                  "sign": "WaitAdmin",
                  "app_id": "867354488",
                  "acc_key": "LTtI2tFasBEVz5EroCj5NNsp",
                  "acc_secret": "E2bZ0Wh5EofT8u5FgsOFdlYdKnbWsz"
                }
              }
        }
